#include "stdafx.h"

#include "FlyTypedef.h"
#include "WindowPlatform.h"
#include "DXRenderDevice.h"
#include "FlyEngine.h"


FlyEngine::FlyEngine() : m_pPlatform(NULL), m_pRenderDevice(NULL)
{
}

FlyEngine::~FlyEngine()
{
	if ( m_pRenderDevice != NULL )
		delete m_pRenderDevice;
}

void FlyEngine::Init( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
{
	//*** window
	m_pPlatform = new PlatformClass;
	if ( m_pPlatform )
		m_pPlatform->Init( hInstance, hPrevInstance, lpCmdLine, nCmdShow );

	m_pRenderDevice = new RenderDeviceClass;
	if ( m_pRenderDevice )
		m_pRenderDevice->Init( m_pPlatform->GetWnd() );
}

void FlyEngine::Tick( unsigned deltaTime )
{
	
}

void FlyEngine::Render()
{
	if ( m_pRenderDevice->BeginScene() )
	{	
			
		m_pRenderDevice->EndScene();
	}
}